#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START bash
#
# depends: readline
# depends: ncurses

reset_mtime bash bash/configure.ac
mkdir -p build/bash
cd build/bash
cat > config.cache << EOF
ac_cv_func_mmap_fixed_mapped=yes
ac_cv_func_strcoll_works=yes
ac_cv_func_working_mktime=yes
bash_cv_func_sigsetjmp=present
bash_cv_getcwd_malloc=yes
bash_cv_job_control_missing=present
bash_cv_printf_a_format=yes
bash_cv_sys_named_pipes=present
bash_cv_ulimit_maxfds=yes
bash_cv_under_sys_siglist=yes
bash_cv_unusable_rtsigs=no
gt_cv_int_divbyzero_sigfpe=yes
EOF

../../bash/configure \
	${CONFIGURE_ARGS} \
	--without-bash-malloc \
	--with-installed-readline \
	--cache-file=config.cache

cd ../..
make_build build/bash
ln -s bash "${stage}${prefix}/bin/sh"
ln -s bash "${stage}${prefix}/bin/bash4"
ln -s bash "${stage}${prefix}/bin/sh4"

# RECIPE END bash
